﻿using System;
using System.Collections.Generic;

namespace SolidQBCPLibrary
{
    public class BCPDataFlow
    {
        public int IdPriority; //-> esto es solo para guardar un id numerico por el que ordenar las ejecuciones de copytable y así poder poner cierta "prioridad" en la copia de objetos

        public bool ForceColumnMapping;

        public bool UseDynamicFilter;
        public string DynamicFilterDataType = "";   // El tipo de datos de la columna usada para el dynamic filter. Esto es útil saberlo en determinados casos, como uniqueidentifier, para poder poner un valor inicial aceptable
        public string DynamicFilterDefinition;
        public string DynamicFilterValue;      // Una vez lanzada la query "DynamicFilterDefinition", el valor de retorno lo guardo como string para luego construir la consulta de origen

        public BCPCredentials sourceCredential;
        public BCPCredentials destinationCredential;

        public BCPObject source;
        public BCPObject destination;

        public BCPDataFlow(BCPCredentials _sourceCredential, BCPCredentials _destinationCredential, BCPObject sourceObject, BCPObject destinationObject)
        {
            sourceCredential = _sourceCredential;
            destinationCredential = _destinationCredential;

            source = sourceObject;
            destination = destinationObject;

        }

        public BCPDataFlow(BCPCredentials _sourceCredential, BCPCredentials _destinationCredential)
        {
            sourceCredential = _sourceCredential;
            destinationCredential = _destinationCredential;

            source = new BCPObject();
            destination = new BCPObject();
        }


        public string SourceConnectionString
        {
            get
            {
                return (sourceCredential.ConnectionString);
            }
        }

        public string DestinationConnectionString
        {
            get
            {
                return (destinationCredential.ConnectionString);
            }
        }


    }
}
